﻿using System;
using System.Collections.Generic;
using System.Text;
using AspNetCs.Model;
using System.Data;
using AspNetCs.IDAL;
using AspNetCs.DALFactory;
namespace AspNetCs.Bll
{
    public class FriendSite
    {
        private IFriendSite Links = Conn.CreateFriendSite();


        #region IFriendSite 成员

        /// <summary>
        /// 添加友情链接
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(FriendSite_Model model)
        {
            if (model == null) return -1;

            return Links.Add(model);
        }


        public int Delete(string filter)
        {
            if (filter == "")
            {
                return -1;
            }
            return Links.Delete(filter);

        }

        public int update(FriendSite_Model model, string filter)
        {
            if (model == null)
            {
                return -1;
            }
            return Links.update(model, filter);
        }

        public FriendSite_Model GetModel(DataRow dr)
        {
            return Links.GetModel(dr);
        }

        public FriendSite_Model GetModel(int id)
        {
            return Links.GetModel(id);
        }
        public string LinkType(int types)
        {
            string Result = "";

            if (types == 1)
            {
                Result = "图片";
            }
            else if (types == 2)
            {
                Result = "文字";
            }
            else if (types == 3)
            {
                Result = "合作伙伴";
            }
            return Result;
        }
        #endregion
    }
}
